package cn.maihe.elg.operation.utils;

import lombok.extern.slf4j.Slf4j;
import org.ofdrw.converter.ofdconverter.PDFConverter;

import java.nio.file.Path;

@Slf4j
public class EnterprisePDF2OFD {
    public static void convert(Path pdfPath, Path ofdPath) {
        try (PDFConverter converter = new PDFConverter(ofdPath)) {
            converter.convert(pdfPath);
        } catch (Exception e) {
            log.error("pdf to ofd error:"+e.getMessage(), e);
            throw new RuntimeException("转换失败", e);
        }
    }
}